import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

export const getTableHeaderInfo = (partName: string) => {
  return http.request<any>(
    "get",
    baseUrlApi(
      "pfmea_file_manage/viewset/pfmea_table_info_list/" + partName + "/"
    )
  );
};

export const getOpInfo = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("pfmea_file_manage/get_op_info/"),
    {
      data
    }
  );
};
export const getPfmeaData = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("pfmea_file_manage/get_op_data/"),
    {
      data
    }
  );
};

export const insertPfmeaData = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("pfmea_file_manage/insert_pfmea_data/"),
    {
      data
    }
  );
};

export const editePfmeaData = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("pfmea_file_manage/edite_pfmea_data/"),
    {
      data
    }
  );
};

export const deletePfmeaData = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("pfmea_file_manage/delete_pfmea_data/"),
    {
      data
    }
  );
};
